<style>
#modal-update {
	padding: 20px 25px 25px 0;
}

#modal-update.layui-treeSelect .ztree li a, .ztree li span {
	margin: 0 0 2px 3px !important;
}

.layui-input-block {
	margin-left: 160px;
}

.layui-form-label {
	width: 130px;
}
</style>
<div class="layui-fluid" id="modal-update">
	<form class="layui-form" action="" lay-filter="modal-update-form">
		<div class="layui-form-item">
			<label class="layui-form-label">errorcode：</label>
			<div class="layui-input-block">
				<input type="text" name="errorcode" autocomplete="off" lay-verify="required"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
				<label class="layui-form-label">category：</label>
				<div class="layui-input-block">
						<input type="text" name="category" autocomplete="off"
						class="layui-input">
				</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">Context：</label>
			<div class="layui-input-block">
				<input type="text" name="context" maxlength="50" autocomplete="off" lay-verify="required"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">description：</label>
			<div class="layui-input-block">
				<textarea name="description" lay-verify="required"
					class="layui-textarea"></textarea>
			</div>
		</div>
				<div class="layui-form-item layui-form-text">
			<label class="layui-form-label">isHandledFlag：</label>
			<div class="layui-input-block">
 <input type="checkbox" name="isHandledFlag" lay-skin="switch">
			</div>
		</div>
		<div class="layui-form-item febs-hide">
			<button class="layui-btn" lay-submit=""
				lay-filter="update-form-submit" id="submit"></button>
		</div>
	</form>
</div>

<script data-th-inline="javascript">
    layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect'], function () {
        var $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            formSelects = layui.formSelects,
            treeSelect = layui.treeSelect,
            form = layui.form,
            $view = $('#modal-update'),
            validate = layui.validate,
            modalData;

        form.verify(validate);
        form.render('radio');

        initFormValue();

        function initFormValue() {
			modalData=parent.tableData;
        	
            form.val("modal-update-form", {
			"category": modalData.category,
			"description":modalData.description,
			"context": modalData.context,
			"errorcode": modalData.errorcode,
			"isHandledFlag":modalData.isHandledFlag
            });
        }

        form.on('submit(update-form-submit)', function (data) {
        	var d=febs.nativeCopy(modalData,data.field);
			if(d.isHandledFlag=='on')
			{
				d.isHandledFlag=1;
			}
			else
			{
				d.isHandledFlag=0
			}
			
            if (febs.nativeEqual(d, modalData)) {
                febs.alert.warn('Data have no changes！');
                return false;
            }
            febs.post(ctx + 'fdiErrorrecord/update', d, function () {
                layer.closeAll();
                febs.alert.success('Data Modified!');
                $('#febs-table-container').find('#query').click();
            });
            return false;
        });
    });
</script>